x = 1230532

f = 0
if x < 0:  # 判断是否是负数
    x = x * -1
    f = 1

ori_list = {}
res_list = {}


def shi(x):
    "用来处理如果x是10的倍数的问题"


def weishu(x):
    "判断x有多少位,并返回x的位数"
    i = 0

    while x >= 10:
        x = x / 10
        x = int(x)
        i = i + 1

    return i + 1  # 返回x的位数


l = weishu(x)  # l代表位数


def tiqu(x, l):
    "提取x的每一位"
    ori_list = {}
    for i in range(l):
        ori_list[i] = x % 10
        x = x / 10
        x = int(x)
    return ori_list


ori_list = tiqu(x, l)


def shengcheng(ori_list, l):
    "生成新的数字"
    res_list = {}
    new_i = l
    result = 0
    for i in range(l):
        res_list[i] = ori_list[i] * (pow(10, new_i - 1))
        new_i = new_i - 1

    for i in range(l):
        result = result + res_list[i]
    return result


result = shengcheng(ori_list, l)
if f == 1:  # 如果输入的数是负数
    result = -1 * result

# 规定是32位整数，判断是否越界
if result >= 2147483647:
    result = 0
if result <= -2147483648:
    result = 0
print(result)
